//
// Created by wze-zero on 2024/9/17 017.
//
#include <iostream>
#include <iomanip>

using namespace std;

int main() {
    double num, sum;
    double score[5][6];
    for (int i = 0; i < 5; ++i) {
        sum = 0;
        for (int j = 0; j < 5; ++j) {
            cin >> num;
            score[i][j] = num;
            sum += num;
        }
        score[i][5] = sum;
    }
    for (int i = 0; i < 5; ++i) {
        for (int j = 0; j < 6; ++j) {
            cout << fixed << setprecision(1) << score[i][j] << " ";
        }
        cout << endl;
    }
    return 0;
}